ISCModelProperty Interface
The following table contains information on the ISCModelProperty interface:
Signature |
Description |
Valid Arguments |
---|---|---|
void Value(VARIANT ValueId [optional], VARIANT ValueType [optional], VARIANT Val ) |
Sets the indicated property value with the given value |
ValueId:
ValueType:
Val:
|
For information about valid property values, see the HTML document erwin Metamodel Reference, in the Metamodel Reference Bookshelf located in the erwin� Data Modeler installation folder.
Example 22
The following example illustrates how to set non-scalar property values using C++. The example uses a Model Object object from Example 9 and assumes that a transaction has opened:
//ISCSession::BeginTransaction() must be called prior to calling this function
// ISCSession::CommitTransaction() must be called upon returning from this // function void SetNameProperty(ISCModelObjectPtr & scObjPtr, CString & csValue) { ISCModelPropertyCollectionPtr propColPtr = scObjPtr->GetProperties(); CString csPropName = "Non-Scalar"; ISCModelPropertyPtr nameProp = propColPtr > GetItem(COleVariant(csPropName)); if (nameProp != NULL) // Setting the first element nameProp->PutValue(COleVariant(0L), (long) SCVT_BSTR, csValue); }
The following example illustrates how to set non-scalar property values using Visual Basic .NET. The example uses a Model Object object from Example 9 and assumes that a transaction has opened:
'ISCSession::BeginTransaction() must be called prior to calling this function
' ISCSession::CommitTransaction() must be called upon returning from this function Public Sub SetScalarPropValue(ByRef scObj As SCAPI.ModelObject, ByRef val As Variant) Dim modelProp As SCAPI.ModelProperty modelProp = scObj.Properties(�Name�) Dim index As Long Index = 0 ' Setting index to zero modelProp.Value(index) = val ' index is used to access non-scalar property End Sub
Copyright © 2025 Quest Software, Inc. |